package com.wt.admin.mapper.chat;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wt.admin.domain.dto.chat.ChatModelFileDTO;
import com.wt.admin.domain.entity.chat.ChatModelFileEntity;
import com.wt.admin.domain.vo.chart.ChatModelFileVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ChatModelFileMapper extends BaseMapper<ChatModelFileEntity> {

    @Delete("delete from chat_model_file where model_id = #{id}")
    void delByModelId(@Param("id") Integer id);

    @Select("select * from chat_model_file where model_id = #{data.modelId} order by create_time desc")
    List<ChatModelFileVO> modeFileList(@Param("data") ChatModelFileDTO data);

    @Select("select * from chat_model_file")
    List<ChatModelFileEntity> listFile();
}
